import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppCommonModule } from '@app/shared/common/app-common.module';
import { UtilsModule } from '@shared/utils/utils.module';
import { CountoModule } from 'angular2-counto';
import { ModalModule, TabsModule, TooltipModule, BsDropdownModule, PopoverModule } from 'ngx-bootstrap';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import {
    BsDatepickerModule,
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService
} from 'ngx-bootstrap/datepicker';
import { NgxBootstrapDatePickerConfigService } from 'assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service';
import { TableModule } from 'primeng/table';
import {
    CalendarModule,
    TreeModule,
    DragDropModule,
    ContextMenuModule,
    PaginatorModule,
    InputMaskModule,
    EditorModule,
    AutoCompleteModule,
    FileUploadModule,
    CheckboxModule,
    MultiSelectModule
} from 'primeng/primeng';

import { ImageCropperModule } from 'ngx-image-cropper';
import { TextMaskModule } from 'angular2-text-mask';

import { TreeTableModule } from 'primeng/treetable';
import { RoomComponent } from './rooms/room.component';
import { CreateOrEditLocationModalComponent } from './rooms/create-or-edit-location-modal.component';
import { CreateOrEditRoomModalComponent } from './rooms/create-or-edit-room-modal.component';
import { StockRoutingModule } from './stock-routing.module';
import { RoomTreeComponent } from './rooms/room-tree.component';
import { RoomIndexComponent } from './rooms/room-index.component';
import { RoomDetailComponent } from './rooms/room-detail.component';
import { LocationComponent } from './rooms/location.component';
import { SupplierComponent } from './supplier/supplier-index.component';
import { CreateOrEditSupplierModalComponent } from './supplier/create-or-edit-supplier-modal.component';
import { ToolTransferComponent } from './tool/tooltransfer/tool-transfer.component';
import { CreateOrEditToolTransferModalComponent } from './tool/tooltransfer/create-or-edit-tool-transfer-modal.component';
import { CreateToolTransferOpinionModalComponent } from './tool/tooltransfer/create-or-edit-tool-transfer-opinion-modal.component';
import { ToolSearchReceiveComponent } from './tool/receive/tool-search-receive.component';
import { UpdateAccountRemarkModalComponent } from './tool/account/update-account-remark-modal.component';
import { ToolBaseFieldComponent } from './tool/base/tool-basefield.component';
import { CreateOrEditToolBaseInfoModalComponent } from './tool/base/create-or-edit-tool-baseinfo-modal.component';
import { ToolBaseFieldDetailModalComponent } from './tool/base/tool-basefield-detail-modal.component';
import { ToolAccountRecordModalComponent } from './tool/account/tool-record-modal.component';
import { ToolBillItemDetailModalComponent } from './tool/account/tool-bill-item-detail-modal.component';
import { ToolIntoBillImteModalComponent } from './tool/return/tool-into-billitem.component';
import { CreateToolReceiveOpinionModalComponent } from './tool/receive/create-or-edit-tool-receive-opinion-modal.component';
import { ToolScrapComponent } from './tool/scrap/tool-scrap.component';
import { CreateOrEditToolScrapBillModalComponent } from './tool/scrap/create-or-edit-tool-scrap-bill-item-modal.component';
import { ToolInventoryComponent } from './tool/inventory/tool-inventory.component';
import { ToolBorrowComponent } from './tool/borrow/tool-borrow.component';
import { CreateOrEditToolBorrowBillModalComponent } from './tool/borrow/create-or-edit-tool-borrow-bill-item-modal.component';
import { ToolUserCardModalComponent } from './tool/borrow/tool-user-card-modal.component';
import { ToolReturnModalComponent } from './tool/borrow/tool-return-modal.component';
import { ToolBorrowOutComponent } from './tool/borrowout/tool-borrow-out.component';
import { CreateOrEditToolBorrowOutBillModalComponent } from './tool/borrowout/create-or-edit-tool-borrow-out-bill-item-modal.component';
import { ToolOutReturnModalComponent } from './tool/borrowout/tool-out-return-modal.component';
import { CreateToolBorrowOutOpinionModalComponent } from './tool/borrowout/create-or-edit-tool-borrowout-opinion-modal.component';
import { ToolCancelComponent } from './tool/cancel/tool-cancel.component';
import { CreateOrEditToolCancelBillModalComponent } from './tool/cancel/create-or-edit-tool-cancel-bill-item-modal.component';
import { CreateOrEditToolReturnBillModalComponent } from './tool/return/create-or-edit-tool-return-bill-item-modal.component';
import { ToolReturnComponent } from './tool/return/tool-return.component';
import { ToolAccountBaseInfoModalComponent } from './tool/account/tool-account-base-info-modal.component';
import { ToolReceiveComponent } from './tool/receive/tool-receive.component';
import { CreateOrEditToolReceiveBillModalComponent } from './tool/receive/create-or-edit-tool-receive-bill-item-modal.component';
import { ToolAccountComponent } from './tool/account/tool-account.component';
import { ToolDeptAccountComponent } from './tool/account/tool-dept-account.component';
import { ToolBaseInfoModalComponent } from './tool/into/tool-base-info-modal.component';
import { ToolIntoComponent } from './tool/into/tool-into.component';
import { CreateOrEditToolIntoBillModalComponent } from './tool/into/create-or-edit-tool-into-bill-modal.component';
import { CreateOrEditToolIntoBillItemModalComponent } from './tool/into/create-or-edit-tool-into-bill-item-modal.component';
import { ToolBaseInfoComponent } from './tool/base/tool-base-info.component';
import { ToolLostIndexComponent } from './tool/lost/tool-lost-index.component';
import { CreateOrEditToolLostBillModalComponent } from './tool/lost/create-or-edit-tool-lost-bill-item-modal.component';
import { ToolLostAccountComponent } from './tool/lost/tool-lost-account.component';
import { ToolMaintainComponent } from './tool/maintain/tool-maintain.component';
import { CreateOrEditToolMaintainBillModalComponent } from './tool/maintain/create-or-edit-tool-maintain-bill-item-modal.component';
import { ToolMaintainAccountComponent } from './tool/account/tool-maintain-account.component';
import { UpdateMaintainStatusModalComponent } from './tool/maintain/update-status-modal.component';
import { CreateToolScrapOpinionModalComponent } from './tool/scrap/create-or-edit-tool-scrap-opinion-modal.component';
import { CreateToolLostOpinionModalComponent } from './tool/lost/create-or-edit-tool-lost-opinion-modal.component';
import { CreateToolMaintainOpinionModalComponent } from './tool/maintain/create-or-edit-tool-maintain-opinion-modal.component';
NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales();

@NgModule({
    imports: [
        FormsModule,
        CommonModule,
        FileUploadModule,
        ModalModule.forRoot(),
        TabsModule.forRoot(),
        TooltipModule.forRoot(),
        PopoverModule.forRoot(),
        BsDropdownModule.forRoot(),
        BsDatepickerModule.forRoot(),
        StockRoutingModule,
        UtilsModule,
        AppCommonModule,
        TableModule,
        TreeModule,
        DragDropModule,
        ContextMenuModule,
        PaginatorModule,
        AutoCompleteModule,
        EditorModule,
        InputMaskModule,
        NgxChartsModule,
        CountoModule,
        TextMaskModule,
        ImageCropperModule,
        CheckboxModule,
        TreeTableModule,
        CalendarModule,
        MultiSelectModule
    ],
    declarations: [
        RoomComponent,
        RoomIndexComponent,
        CreateOrEditLocationModalComponent,
        CreateOrEditRoomModalComponent,
        RoomTreeComponent,
        RoomDetailComponent,
        LocationComponent,
        SupplierComponent,
        CreateOrEditSupplierModalComponent,

        ToolTransferComponent,
        CreateOrEditToolTransferModalComponent,
        CreateToolTransferOpinionModalComponent,
        ToolSearchReceiveComponent,
        UpdateAccountRemarkModalComponent,
        ToolBaseFieldComponent,
        CreateOrEditToolBaseInfoModalComponent,
        ToolBaseFieldDetailModalComponent,
        ToolAccountRecordModalComponent,
        ToolBillItemDetailModalComponent,
        ToolIntoBillImteModalComponent,
        CreateToolReceiveOpinionModalComponent,
        CreateOrEditToolScrapBillModalComponent,
        ToolInventoryComponent,
        ToolBorrowComponent,
        CreateOrEditToolBorrowBillModalComponent,
        ToolUserCardModalComponent,
        ToolReturnModalComponent,
        ToolBorrowOutComponent,
        ToolOutReturnModalComponent,
        ToolCancelComponent,
        ToolReturnComponent,
        CreateOrEditToolReturnBillModalComponent,
        ToolScrapComponent,
        CreateToolScrapOpinionModalComponent,
        CreateOrEditToolBorrowOutBillModalComponent,
        CreateToolBorrowOutOpinionModalComponent,
        CreateOrEditToolCancelBillModalComponent,
        ToolAccountBaseInfoModalComponent,
        ToolReceiveComponent,
        CreateOrEditToolReceiveBillModalComponent,
        ToolAccountComponent,
        ToolDeptAccountComponent,
        ToolIntoComponent,
        ToolBaseInfoModalComponent,
        CreateOrEditToolIntoBillModalComponent,
        CreateOrEditToolIntoBillItemModalComponent,
        ToolBaseInfoComponent,
        //工具丢失
        ToolLostIndexComponent,
        CreateOrEditToolLostBillModalComponent,
        ToolLostAccountComponent,
        CreateToolLostOpinionModalComponent,
        //工具维修
        ToolMaintainComponent,
        CreateOrEditToolMaintainBillModalComponent,
        ToolMaintainAccountComponent,
        UpdateMaintainStatusModalComponent,
        CreateToolMaintainOpinionModalComponent
    ],

    providers: [
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDaterangepickerConfig
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale
        }
    ]
})
export class StockModule { }
